package cz.muni.fi.hauntedhouses.dao;

import cz.muni.fi.hauntedhouses.enums.Fear;
import cz.muni.fi.hauntedhouses.enums.Gender;
import cz.muni.fi.hauntedhouses.to.HouseTO;
import cz.muni.fi.hauntedhouses.to.HumanTO;
import java.util.List;

/**
 *
 * @author Vanda Cabanová, 325371
 */
public interface HumanDAO {
    /**
     * Creates new human
     * @param human Human to create
     * @throws NullPointerException when parameter is null
     */
    void create(HumanTO humanTo);
    
    /**
     * Updates given Human. If given Human does not exist in the database,
     * it is only created.
     * @param human Human with new parameters
     * @throws NullPointerException on null given
     */
    void update(HumanTO humanTo);
    
    /**
     * Removes given Human. If given Human is not in the database, nothing happens
     * since it was intented not to have it in DB anymore.
     * @param human Human to be removed
     * @throws NullPointerException if given parameter is null
     * 
     */
    void remove(HumanTO humanTo);
    
    /**
     * Returns Human with given ID
     * @param id ID from database
     * @return Human with given ID
     * @throws IllegalArgumentException if id is null or less than 1
     */
    HumanTO get(Long id);   
    
    /**
     * Returns list of all existing Humans from DB
     * @return List of Humans
     */
    List<HumanTO> findAll();
    
    /**
     * Returns list of all existing Humans with given name from DB.
     * Returns empty collection if there is no such Human.
     * @param name a human name
     * @return List of humans with given name
     */
    List<HumanTO> findByName(String name);
    
}
